<template>
    <div class="index">
        <p class="nickName" v-if="userInfo.nickname">
            我的昵称：{{ userInfo.nickname }}<br />
            我的头像：<img :src="userInfo.headimgurl" />
        </p>
        <div class="btn-group">
            <a href="javascript:;">分享</a>
            <router-link :to="{ name: 'pay_wechatpay' }">充值</router-link>
            <router-link :to="{ name: 'activity_detail' }">活动详情</router-link>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'index',
        watch: {

        },
        created() {
            if (this.$cookie.get('openId')) {
                // 获取用户信息
                this.getUserInfo();
            }
        },
        mounted() {

        },
        data() {
            return {
                userInfo: {}
            };
        },
        methods: {
            async getUserInfo() {
                let res = await this.$axios.wechat.getUserInfoHandle({
                    params: {}
                });

                this.userInfo = res.data.responseData;
            }
        },
        computed: {

        },
        components: {

        }
    };

</script>

<style lang="css" scoped>
    .nickName {
        position: absolute;
        left: 0;
        top: 0;
        z-index: 999999;
    }

    .index {
        width: 100%;
        height: 100%;
        background-color: #FFC93A;
    }

    .btn-group {
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
    }

    .btn-group a {
        display: block;
        width: 710px;
        height: 92px;
        background-color: #6ca4d3;
        font-weight: normal;
        font-size: 36px;
        line-height: 92px;
        color: #fff;
        text-align: center;
        margin-bottom: 30px;
        border-radius: 15px;
    }

    .btn-group a:nth-of-type(2) {
        background-color: #c54456;
    }
</style>
